import axios from "@/request/http";
export default {
    //开启命名空间
 namespaced: true,
 //<!-- 在.vue文件中通过this.$store.state.xxx来进行获取 -->
 state: {
   name: "许运科",
   list:[],
   type:[],
   qlist:[],
  //  slist:[]
 },
/*  getters: {
  newName(state){
      return state.name + '的模块'
  }
}, */
mutations: {
  INIT_LIST(state, { data }) {
    state.list = data.data
},
 GETTYPE_LIST(state,{data}){
   state.type = data.data
 },
 QUESTION_LIST(state,{data}){
   state.qlist = data.data
 },
//  SEARCH_LIST(state,{data}){
//   state.slist = data.data
// }
},
actions: {
  init({commit}){
    axios.post('/Lawyer/findAllLawyer').then(data => {
      commit("INIT_LIST", {
        data,
    })
    })
  },
  gettype({commit}){
    axios.post('/ProblemStyle/findAllProblemStyle').then(data => {
      commit("GETTYPE_LIST", {
        data,
    })
    })
  },
  getquestion({commit}){
    axios.post('/Consult/addConsultByUserId').then(data => {

      commit("QUESTION_LIST", {
        data,
    })
    })
  },
  // searchlawyer({commit},name){
  //   axios.get(`/lawyer/lawyer/findLawyerListByLikeName?name=${name}`).then(data => {
  //     console.log(data);
  //     commit("SEARCH_LIST", {
  //       data,
  //   })
  //   })
  // }
},
}
